<template>
  <ant-modal
    modalWidth="800"
    modalHeight="550"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model
      ref="form"
      :model="form"
      :rules="rules"
      slot="content"
      layout="vertical"
    >
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="期数" prop="period">
            <a-input-number
              v-model="form.period"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="本金金额" prop="principal">
            <a-input-number
              v-model="form.principal"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="利息" prop="interest">
            <a-input-number
              v-model="form.interest"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="月供金额" prop="monthPayment">
            <a-input-number
              v-model="form.monthPayment"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="剩余本金" prop="remainingPrincipal">
            <a-input-number
              v-model="form.remainingPrincipal"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="是否逾期" prop="isOverdue">
            <a-radio-group v-model="form.isOverdue" button-style="solid">
              <a-radio-button
                v-for="(dict, index) in isOverdueOptions"
                :key="index"
                :value="dict.dictValue"
              >
                {{ dict.dictLabel }}
              </a-radio-button>
            </a-radio-group>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="逾期天数" prop="overdueDays">
            <a-input-number
              v-model="form.overdueDays"
              :min="0"
              style="width: 100%"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="逾期说明" prop="overdueRemark">
            <a-textarea
              v-model="form.overdueRemark"
              placeholder="请输入逾期说明"
              :rows="4"
            />
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button @click="cancel"> 取消 </a-button>
      <a-button type="primary" @click="submitForm"> 保存 </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizLoanBillDetailAddForm from "./BizLoanBillDetailForm";
export default {
  ...BizLoanBillDetailAddForm,
};
</script>
